/**
 * 数组&对象&接口
*/
let arr = [1,2,3,4]
let [x,y,z] = arr;  
console.log(x,y,z);

interface Person {
    readonly name: string;
    age?: number;
    pClass:string
}
let zhang:Person = {
    name:'zhangsan',
    pClass:'human'
    // age:33
}
// zhang.name = 'ss' Cannot assign to 'name' because it is a read-only property.

// 任意属性：可以自己添加任意属性
interface Person2 {
    name:string;
    age?:number;
    [propName:string]:any;
}
let zhang2:Person2 = {
    name:'zhangsan2',
    age:1,
    sex:'sss'
}

// 接口继承了接口，那么这些必需的属性都要实现
interface Man extends Person{
    name1:string,
    age1:number
}

let m1:Man = {
    name:'zhangsanF',
    name1:'zhangsan',
    age1:20,
    pClass:'person'
}